package pro.cherish.knowledgewebflux.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import pro.cherish.knowledgewebflux.service.HelloService;
import pro.cherish.knowledgewebflux.util.ThreadContextHandler;

/**
 * @author 创建人：lys
 * @version 版本号：V1.0
 * <p>
 * ***************************修订记录************************************
 * 2020-5-29 lys 创建该类功能。
 * **********************************************************************
 * </p>
 * @ClassName 类名：HelloServiceImpl
 * @Description 功能说明：
 * <p>
 * TODO
 * </p>
 * **********************************************************************
 * @date 创建日期： 2020-5-29 
 */
@Slf4j
@Service
public class HelloServiceImpl implements HelloService {
	@Autowired
	private AsyncTask asyncTask;
	@Override
	public void sayHello() {
		Object name = ThreadContextHandler.get("name");
		log.info(name.toString());
		Thread currentThread = Thread.currentThread();
		log.info("sayHello线程ID={}，线程名称={}",currentThread.getId(),currentThread.getName());
		asyncTask.doSomething();
		log.info("hello");
	}
}
